<template>
    <div>
        登录成功,马上跳转
    </div>
</template>
<script setup lang='ts'>
    import { reactive, onMounted, onBeforeMount } from 'vue'
    import { useRoute } from "vue-router";
    import useUserStore from '@/store/modules/user'

    const user = reactive({
        userToken: '',
        username: '',
        userpic: ''
    })

    let $route = useRoute()
    let userStore = useUserStore()
    onMounted(() => {

        const username = decodeURIComponent($route.query.username);
        user.userToken = $route.query.userToken
        user.username = username
        user.userpic = $route.query.avatar

        userStore.loadCurrentUser(user)
        userStore.loadUserToken(user.userToken)
    })



</script>


<style scoped>
</style>